package com.linkgie.galaxyframework.metadata.structure;

import javax.validation.constraints.NotBlank;

import com.linkgie.galaxyframework.metadata.DataEntity;
import com.linkgie.galaxyframework.metadata.DataField;
import com.linkgie.galaxyframework.metadata.DataInterface;
import com.linkgie.galaxyframework.metadata.Reference;

/**
 * 聚合关系元数据；
 * 
 * @author huanghaiquan
 *
 */
@DataInterface
@DataEntity
public class ReferenceMetadata implements Reference {

	/**
	 * TODO：引用 {@link DataModelMetadata}；
	 */
	@NotBlank
	@DataField(name = "外键类型", order = 0)
	private String model;

	/**
	 * TODO：引用 {@link DataInterfaceMetadata}；
	 */
	@NotBlank
	@DataField(name = "外键接口", order = 1)
	private String interfase;

	/**
	 * TODO：引用 {@link DataInterfaceMetadata}；
	 */
	@DataField(name = "条件接口", order = 2)
	private String conditionInterface;
	
	@DataField(name = "值字段", order = 3)
	private String valueKey;

	/**
	 * TODO：引用 {@link DataInterfaceMetadata}；
	 */
	@DataField(name = "标题字段", order = 4)
	private String labelKey;

	@DataField(name = "级联字段", order = 5)
	private String cascadeKey;

	@DataField(name = "级联分隔符", order = 6)
	private String cascadeSeperator;

	@DataField(name = "是否刷新", order = 7)
	private Boolean refreshObjects;

	@Override
	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	@Override
	public String getInterfase() {
		return interfase;
	}

	public void setInterfase(String interfase) {
		this.interfase = interfase;
	}

	@Override
	public String getConditionInterface() {
		return conditionInterface;
	}

	public void setConditionInterface(String conditionInterface) {
		this.conditionInterface = conditionInterface;
	}

	@Override
	public String getLabelKey() {
		return labelKey;
	}

	public void setLabelKey(String labelKey) {
		this.labelKey = labelKey;
	}

	@Override
	public String getValueKey() {
		return valueKey;
	}

	@Override
	public String getCascadeKey() {
		// TODO Auto-generated method stub
		return cascadeKey;
	}

	@Deprecated
	@Override
	public String getCascadeSeperator() {
		// TODO Auto-generated method stub
		return cascadeSeperator;
	}

	@Deprecated
	@Override
	public boolean getRefreshObjects() {
		return refreshObjects;
	}

	public void setValueKey(String valueKey) {
		this.valueKey = valueKey;
	}

	public void setCascadeKey(String cascadeKey) {
		this.cascadeKey = cascadeKey;
	}

	public void setCascadeSeperator(String cascadeSeperator) {
		this.cascadeSeperator = cascadeSeperator;
	}

	public void setRefreshObjects(Boolean refreshObjects) {
		this.refreshObjects = refreshObjects;
	}

}
